package study.async.springboot.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@Slf4j
@RestController
public class TestingController {

    private String HOST = "http://152.136.206.109:7500";

    @Autowired
    private RestTemplate restTemplate;

    @GetMapping(value = "/testing/block/{times}")
    public String block(@PathVariable int times) {
        return restTemplate.getForObject(HOST + "/sleep/" + times, String.class);
    }
}
